#ifndef _RSDISK_H_H_
#define _RSDISK_H_H_

#include <windows.h>
#include <string>

using namespace std;

class RSDISK
{
public:
	volatile bool m_mount;
	string m_idName;
	char m_driveLetter;
	char m_remoteLetter;
	int m_deviceNumber;
	BYTE m_diskType;
	LONGLONG m_diskSize;
	HANDLE m_hDiskFile;
	string m_runPath;
	CRITICAL_SECTION m_cs;

	bool FileDiskMount();
	bool CreateDiskFile();
	bool KillActiveProc();

public:
	RSDISK();
	~RSDISK();

	bool WriteDiskFile(LONGLONG off,UINT len,BYTE *buf);
	bool ReadDiskFile(LONGLONG off,UINT len,BYTE *buf);

	bool TalkDriverBlock(UINT num);
	bool FileDiskUnMount();
	bool MountDisk();
	void RunGame();

	bool Init(string &idName,LONGLONG diskSize,string runPath);
};

#endif